# $Id$
# Maintainer: AndyRTR <andyrtr@archlinux.org>
# Contributor: Gerhard Brauer <gerbra@archlinux.de>
# Contributor: Richard Murri <admin@richardmurri.com>

pkgname=x2goclient
pkgver=4.1.2.1
pkgrel=3
arch=('x86_64')
license=('GPL2')
url="http://www.x2go.org"
pkgdesc="a graphical client (Qt4) for the X2Go system"
makedepends=('qt5-tools' 'man2html' 'xdg-utils' 'xorg-xauth')
depends=('qt5-x11extras' 'qt5-svg'
         'libldap' 'libcups' 'nxproxy' 'libssh' 'libxpm' 'hicolor-icon-theme')
# FS#48088
optdepends=('xorg-xauth: may be required by X2goservers running a different linux distribution giving MIT-COOKIE errors')
source=(https://code.x2go.org/releases/source/${pkgname}/${pkgname}-${pkgver}.tar.gz{,.asc}
        x2goclient-qt5.11.patch)
sha256sums=('1c18981f0a39929624de9472b0e6c3fa2ac7842837dd306db318af54c5fff2af'
            'SKIP'
            '2d6c85698ddb556984573037cd78a403e49b346d11828a69963bbd2b3f1354b2')
validpgpkeys=('9BFBAEE86C0AA5FFBF2207829AF46B3025771B31'  # Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
              '1AD23D1B8F087A35AB74BDE9F4A7678C9C6B0B2B') #  "X2go Git Administrator <git-admin@x2go.org>"

prepare() {
  cd ${pkgname}-${pkgver}
  sed -i "s:-o root -g root ::" Makefile
  sed -i -e 's/qt4/qt5/' Makefile
  patch -Np1 -i ../x2goclient-qt5.11.patch
  sed -e 's/-lssh_threads//' -i x2goclient.pro # Fix build with libssh 0.8
}

build() {
  cd ${pkgname}-${pkgver}
  make PREFIX=/usr
  make PREFIX=/usr build_man
}

package() {
  
  cd ${pkgbase}-${pkgver}
  make PREFIX=/usr DESTDIR="$pkgdir" install_client install_man
}
